package com.example.demo.domian;


import java.util.Objects;

public class Student {

    private String studentNo;

    private String name;

    private String age;

    private String sex;

    private String school;

    private String studentClass;

    public Student() {
    }

//    @Override
//    protected Object clone() throws CloneNotSupportedException {
//        /**
//         * 浅拷贝
//         */
//        return super.clone();
//    }

    public Student(String studentNo, String name, String age, String sex, String school,String studentClass) {
        this.studentNo = studentNo;
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.school = school;
        this.studentClass = studentClass;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Student student = (Student) o;
        return Objects.equals(studentNo, student.studentNo) && Objects.equals(name, student.name) && Objects.equals(age, student.age) && Objects.equals(sex, student.sex) && Objects.equals(school, student.school) && Objects.equals(studentClass, student.studentClass);
    }

    @Override
    public int hashCode() {
        return Objects.hash(studentNo, name, age, sex, school, studentClass);
    }

    @Override
    public String toString() {
        return
                "学号=" + studentNo +"\t" +
                "姓名=" + name +"\t" +
                "年龄=" + age +"\t" +
                "性别=" + sex +"\t" +
                "学院=" + school +"\t" +
                "班级=" + studentClass ;
    }

    public String getStudentNo() {
        return studentNo;
    }

    public void setStudentNo(String studentNo) {
        this.studentNo = studentNo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    public String getStudentClass() {
        return studentClass;
    }

    public void setStudentClass(String studentClass) {
        this.studentClass = studentClass;
    }
}
